home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / gapdemo2.zip / UPCHECK.ZIP / UPCHECK3.BAT < prev   
DOS Batch File  |  1993-01-12  |  3KB  |  79 lines

  1. @echo off
  2. REM     Be sure to remove ALL these REM statements since they
  3. REM     slow down batch files!
  4.  
  5. REM     Additional information that can be placed in an UPCHECK.BAT
  6. REM     file to extract a DESC.SDI or FILE_ID.DIZ from an archive
  7. REM     so that GAP will automatically use the description file as
  8. REM     the file description for the current upload that it is
  9. REM     processing.
  10.  
  11. REM     *************************************************************
  12. REM     *                          NOTE                             *
  13. REM     *                                                           *
  14. REM     *  The extracting of a DESC.SDI or FILE_ID.DIZ file should  *
  15. REM     *  be performed AFTER you have done all your other UPCHECK  *
  16. REM     *  routines such as testing the archive, scanning for       *
  17. REM     *  viruses, etc. You do NOT want to extract a description   *
  18. REM     *  file first, then go and test the archive only to find    *
  19. REM     *  out it is defective or has a virus.                      *
  20. REM     *                                                           *
  21. REM     *  Add these description file routines in the appropriate   *
  22. REM     *  place in your UPCHECK file where you have determined     *
  23. REM     *  that the archive is suitable for posting on your board.  *
  24. REM     *                                                           *
  25. REM     *  If you do not normally use an UPCHECK to check for       *
  26. REM     *  viruses or file integrity, then you can simply use this  *
  27. REM     *  file as is (naming it UPCHECK.BAT), to extract the       *
  28. REM     *  description file (if present) from a ZIP.                *
  29. REM     *************************************************************
  30.  
  31. REM     GAP passes the following parameters to the UPCHECK.BAT file:
  32.  
  33. REM             Full path and name of file    (%1)
  34. REM             Upload Directory path        (%2)
  35. REM             Filename            (%3)
  36. REM             Filename without the extension    (%4)
  37. REM             Extension without the filename    (%5)
  38. REM                     "NONE" if no extension
  39. REM             Local/Remote code               (%6)
  40. REM                     0 = Remote Caller
  41. REM                     1 = Local Sysop 
  42. REM                     2 = Local Caller
  43.  
  44. REM     Determine type of Archive we are dealing with
  45. REM     This example tests for ZIP files ONLY!
  46.  
  47.     if "%5"=="ZIP" goto DES_ZIP
  48.     goto DONE_DES
  49.  
  50. :DES_ZIP
  51.  
  52. REM     Process ZIP files
  53.  
  54. REM     First try to unzip a DESC.SDI file into the upload (work) directory
  55.  
  56.         pkunzip -o %1 %2\ DESC.SDI >NUL
  57.  
  58. REM     If DESC.SDI is not in the ZIP, try to unzip FILE_ID.DIZ
  59.  
  60.         if errorlevel 1 goto DES_ZIP1
  61.         goto DONE_DES
  62.  
  63. :DES_ZIP1
  64.  
  65. REM     If we come here, then DESC.SDI was not contained in the
  66. REM     ZIP, so we willl now check for FILE_ID.DIZ
  67.  
  68.         pkunzip -o %1 %2\ FILE_ID.DIZ >NUL
  69.  
  70. REM     We are done extracting either DESC.SDI or FILE_ID.DIZ (we
  71. REM     only want one of the files not both). We really don't even
  72. REM     care if the file was extracted or not since GAP will handle
  73. REM     all the details for us. 
  74. REM     If we DID extract one of the two files, we made sure to
  75. REM     simply leave it in the work directory. GAP will detect that
  76. REM     it is there and delete it after it is finished with it.
  77.  
  78. :DONE_DES
  79.